<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>平均分</title>
	<script type="text/javascript">
		//三个班级各4名学员参赛，计算每个班级参赛学员平均分，只统计成绩大于85分的学员
			var sum=0;
			var avg=0;
			var avg1=0;
			var sum1=0;
			var k=0;
			for(var i=1;i<=3;i++){
				for(var j=1;j<=4;j++){
					var sco=Number(prompt('请输入第'+i+'班第'+j+'个同学的成绩'));
					sum+=sco;
					sum1+=sco;
					if (sco<=85) {
						continue;
					}
					k++;
					// console.log('第'+i+'班第'+j+'个同学的成绩为'+sco);
				}
				avg1=sum1/4;
				console.log(i+'班的平均分为'+avg1);
				sum1=0;
			}
					avg=sum/12;
					console.log('有'+k+'个人考85分以上');
					console.log('平均分为'+avg);
	</script>
</head>
<body>
	
</body>
</html>